﻿using EmptoolWebApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace EmptoolWebApp.WebApi
{
    public class HelloBotController : ApiController
    {
        // GET api/<controller>
        public IEnumerable<string> Get()
        {
            log4net.ILog log = log4net.LogManager.GetLogger("EmpToolWebsiteLog");
            log.Error("REACHED HELLOBOT GETGET");
            return new string[] { "value1", "value2" };
        }

        // GET api/<controller>/5
        public string Get(int id)
        {
            return "value";
        }

        // POST api/<controller>
        public SlackBotResponse Post([FromBody]string value)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("EmpToolWebsiteLog");
            log.Error("REACHED HELLOBOT" + value);

            //return "{ \"text\" : \"asd\"; }";
            SlackBotResponse sbr = new SlackBotResponse();
            sbr.text = "YAY!!!!";

            return sbr;
        }

        // PUT api/<controller>/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/<controller>/5
        public void Delete(int id)
        {
        }
    }
}